<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style type="text/css">
div#picbox>a>img {
	max-width: 200px;
	max-height: 150px;
} /* for firefox & ie7 */
div#picbox>a>img { /* for ie6 */
	width: expression(this.width > 200 && this.width > this.height ? 200 : auto);
	height: expression(this.height > 150 ? 150 : auto);
}

img#titlepic {
	float:right;
	max-width: 400px;
	max-height: 300px;
	width: expression(this.width > 400 && this.width > this.height ? 400 : auto);
	height: expression(this.height > 300 ? 300 : auto);
}

div#picbox {
	width:900px;
	height:200px;
	overflow:hidden;
	white-space:nowrap;
}

span.popintro, span.sciintro {
	display:block;
}
</style>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript">
$(document).ready(function() {
	//$('span.sciintro').hide();
	$('label.popintro').toggle(function() {
		$('span.popintro').hide('slow');
	}, function() {
		$('span.popintro').show('slow');
	});	
	$('label.sciintro').toggle(function() {
		$('span.sciintro').show('slow');
	}, function() {
		$('span.sciintro').hide('slow');
	});	
});
</script>
<%
set conn=server.createobject("adodb.connection")
conn.open "provider=microsoft.jet.oledb.4.0;data source="&server.mappath("App_Data\MainDB.mdb")
set rs=server.createobject("adodb.recordset")
myid=request.QueryString("id")
rs.open "SELECT * FROM [Species] WHERE SpeciesID=" & myid,conn,3,3
if rs.eof then
%>
<title>查无植物</title>
</head>
<body>
查无植物
</body>
</html>
<%
	rs.close
	set rs=nothing
	conn.close
	set conn=nothing
	response.End()
end if
%>
<title><%=rs("ChineseName") %></title>
</head>

<body>
<div id="banner"><a href="/"><img src="images/banner.jpg" style="width:1000px;height:200px;" /></a></div>
<div>
	<img id="titlepic" src="<%
			if isNULL(rs("filepath")) then
				response.Write("images/unknown.jpg")
			else
				response.Write(rs("filepath"))
			end if
		%>" />
	<label>中文名：</label><%=rs("ChineseName") %><br />
	<label>学名：</label><span style="font-style:italic;"><%
		str=rs("ScientificName")
		pos=InStr(str," ")
		pos=pos+InStr(mid(str,pos+1,len(str))," ")
		if pos=0 or pos=instr(str," ") then
			pos=len(str)
		end if
		response.Write(left(str,pos-1))
	%></span><%=" " & mid(str,pos+1,len(str))%><br />
	<label>俗名：</label><%=rs("CommonName") %><br />
	<label class="popintro">科普简介：</label><span class="popintro"><%
		popintro=rs("PopIntro")
		popintro=Replace(Replace(popintro, vbCrlf, "<br />"), chr(32)&chr(32), "<br />")
		response.Write(popintro)
	%></span><br />
	<label class="sciintro">专业简介：</label><span class="sciintro"><%
		sciintro=rs("SciIntro")
		sciintro=Replace(Replace(sciintro, vbCrlf, "<br />"), chr(32)&chr(32), "<br />")
		response.Write(sciintro)
	%></span><br />
	<a href="addpic.asp?id=<%=myid %>">添加图片</a><br />
</div>
<div id="picbox">
<%
rs.close
rs.open "SELECT * From [Pics] WHERE isDel=False AND SpeciesID=" & myid,conn,3,3
while (not rs.eof)
	response.Write("<a href=""delpic.asp?id=" & rs("PicID") & """ ><img src=" & rs("PicURL") & " style=""margin:10px;"" /></a>")
	rs.movenext
wend
rs.close
set rs=nothing
conn.close
set conn=nothing
%>
</div>
</body>
</html>
